<?php
	include_once 'classes/DBClass.php';
	include_once 'classes/Product.php';
	
class Basket {
	var $total = 0;
	function __construct(){
	
	}
	
	function addProduct($pID){
		$basketArray = $_SESSION["basketArray"];
		$basketArray[$pID] = $pID;
		$_SESSION["basketArray"] = $basketArray;
	}
	function addToTotal($price){
		$this->total += $price;
	}
	function showProducts($pList){
		
	if(true){
		$ii = 1;
	foreach ($pList as $prd) {
		$nPrd = new Product();
		$nPrd->setProduct($prd);
		
?>
 <tr>
  <td class="basket-zebra-<?php echo $ii % 2;?>-0 basket-item type2 frst">
    <input type="checkbox" name="delete-8325625" id="delete-basket-item-8325625">
  </td> 
  
  <td class="basket-zebra-<?php echo $ii % 2; $ii++;?>-1 basket-item type2">
    <table width="100%">
    <tbody><tr>
    <td valign="middle">
      <div class="details">
        <h1><a href="/infophp/product.php?ID=<?php echo $nPrd->product_id;?>"><?php echo $nPrd->name;?></a></h1>
        <?php echo $nPrd->cat_name;?><br>
        
          : <?php echo $nPrd->product_id;?>
          
        
      </div>
    </td>
    </tr>
    </tbody></table>
  </td>
  <td class="basket-zebra-1-0 basket-item type2">
    
  </td>
  <td class="basket-zebra-1-1 basket-item type2">
    <span class="single-price"><?php echo $nPrd->price * 120 / 100;?></span>
  </td>
  <td class="basket-zebra-1-0 basket-item type2">
    <span class="total-price"><?php echo $nPrd->price; $this->addToTotal($nPrd->price); ?></span>
  </td>
      </tr>
      <!-- Dashed Seperator --><tr><td colspan="5" class="dash-bg"></td></tr>
<?php 		
			}
		}
	}
}
?>